summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-03-07 09:55:41 +0100
committeraxis <qt-info@nokia.com>2011-04-27 12:05:59 +0200
commit257126ed02446f05b082d3313866067faf0a5d80 (patch)
tree3c850ca2f9afffead7af5416b127328921e6ab8c
parent4157e24d46be32a4cc5156d6c77ef8b5c82d1419 (diff)
Fixed uic3 test by adding extra bin/ dir to the PATH.
-rw-r--r--tests/auto/uic3/tst_uic3.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/uic3/tst_uic3.cpp b/tests/auto/uic3/tst_uic3.cpp
index d9ab0db..d4e30e6 100644
--- a/tests/auto/uic3/tst_uic3.cpp
+++ b/tests/auto/uic3/tst_uic3.cpp
@@ -73,17 +73,26 @@ private:
tst_uic3::tst_uic3()
: uic3Exists(true)
- , command(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/uic3"))
+ , command(QLatin1String("uic3"))
{
}
void tst_uic3::initTestCase()
{
+ // Append the bin/ dir to the path, in order to find uic3.
+#ifdef Q_OS_WIN
+ const QString sep = ";";
+#else
+ const QString sep = ":";
+#endif
+ QString path = QString::fromLocal8Bit(qgetenv("PATH"));
+ path = QDir::cleanPath(QDir::currentPath() + "/../../../bin") + sep + path;
+ qputenv("PATH", path.toLocal8Bit());
+
QProcess process;
process.start(command, QStringList(QLatin1String("-help")));
if (!process.waitForFinished()) {
uic3Exists = false;
- const QString path = QString::fromLocal8Bit(qgetenv("PATH"));
QString message = QString::fromLatin1("'%1' could not be found when run from '%2'. Path: '%3' ").
arg(command, QDir::currentPath(), path);
QFAIL(qPrintable(message));